import { defHttp } from '@/utils/http/axios';

export function saveFormData(data) {
  return defHttp.post({ url: '/workflow/formData', data });
}

export function updateFormData(data) {
  return defHttp.put({ url: '/workflow/formData', data });
}

export function getFormData(id) {
  return defHttp.get({ url: `/workflow/formData/${id}` });
}

// 通过流程实例ID获取表单数据
export function getFormDataByInstanceId(instanceId) {
  return defHttp.get({ url: `/workflow/formData/byInstance/${instanceId}` });
}

export function getFormDataList(params) {
  return defHttp.get({ url: '/workflow/formData/list', params });
} 